import java.util.Objects;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        Book b1 = new Book(s.next(),
                s.nextInt(),
                s.next(),
                s.nextInt());
        Book b2 = new Book(s.next(), s.nextInt(), s.next(), s.nextInt());

        System.out.println(b1);
        System.out.println(b2);
        System.out.println(b1.equals(b2));

    }
}

class Book {
    String name;
    int price;
    String author;
    int edition;

    public Book(String name, int price, String author, int edition) {
        this.name = name;
        this.price = price;
        this.author = author;
        this.edition = edition;
    }

    @Override
    public String toString() {
        return "name: " + this.name + ", price: " + this.price + ", author: " + this.author + ", edition: " + this.edition;
    }

    public boolean equals(Book b) {
        //equalsIgnoreCase()作用是用来比较字母的长度和字符是否相同,且不区分大小写。
        if (name.equalsIgnoreCase(b.name) && author.equalsIgnoreCase(b.author) && edition == b.edition) {

            return true;
        }
        return false;

    }

}
